home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / miami20a / install_miami next >
Text File  |  1997-01-30  |  8KB  |  298 lines

  1. (procedure check-system-version
  2.  (set exec-version (/ (getversion) 65536))
  3.  (if (< exec-version 37)
  4.   (abort "Miami 2.0 needs Kickstart 2.04 or higher.\n")
  5.  )
  6.  (if (< exec-version 39)
  7.   (set ag-browser "AmigaGuide")
  8.   (set ag-browser "MultiView")
  9.  )
  10. )
  11.  
  12. (procedure select-destination-directory
  13.  (if (exists "Miami:" (noreq))
  14.   (
  15.    (set old-miami-assign 1)
  16.    (set old-miami-assign-location (expandpath "Miami:"))
  17.    (set @default-dest
  18.     (askdir
  19.      (prompt "Select the directory where you want to "
  20.       "install Miami 2.0. You already have a 'Miami:' "
  21.       "assign on your system, so it is assumed that this "
  22.       "is the location of an older version of Miami that "
  23.       "you want to upgrade.")
  24.      (help "Select the directory where you want to "
  25.       "install Miami 2.0. Since you already have a 'Miami:' "
  26.       "assign on your system you should probably accept "
  27.       "the default.")
  28.      (default "Miami:")
  29.     )
  30.    )
  31.   ) (
  32.    (set old-miami-assign 0)
  33.    (set @default-dest
  34.     (askdir
  35.      (prompt "Select the directory where you want to "
  36.       "install Miami 2.0. Most of the files do not have "
  37.       "to be copied if you accept the default. A separate "
  38.       "directory WILL NOT be created at the location you "
  39.       "specify.")
  40.      (help "Select the directory where you want to "
  41.       "install Miami 2.0. You can choose to install "
  42.       "'in-place', i.e. within the directory where your "
  43.       "Miami files are currently located, or you can have "
  44.       "Miami installed in a different location, copying "
  45.       "all files.")
  46.      (default source-dir)
  47.     )
  48.    )
  49.   )
  50.  )
  51.  (makeassign "Miami:" @default-dest)
  52. )
  53.  
  54. (procedure check-registered
  55.  (set is-registered (exists (tackon @default-dest "Miami.key2")))
  56. )
  57.  
  58. (procedure select-cpu
  59.  (if is-registered
  60.   (set cpu-choice
  61.    (askchoice
  62.     (prompt "Please select which version of\nMiami you want to use:")
  63.     (help "Miami exists in an 68000 version\nand an 68020 version. The "
  64.      "68020 version\ncan only be used by registered users.")
  65.     (choices "68000 version" "68020 version")
  66.    )
  67.   )
  68.   (set cpu-choice 0)
  69.  )
  70. )
  71.  
  72. (procedure select-icon
  73.  (set icon-choice
  74.   (askchoice
  75.    (prompt "Please select which icons you\nwant to use:")
  76.    (help "Miami comes with three different\nicon styles. Please select\n"
  77.     "the one you prefer.")
  78.    (choices "standard" "Magic Workbench" "NewIcons")
  79.   )
  80.  )
  81. )
  82.  
  83. (procedure check-in-place
  84.  (set is-in-place
  85.   (= (expandpath source-dir) (expandpath @default-dest))
  86.  )
  87. )
  88.  
  89. (procedure copy-file
  90.  (copyfiles
  91.   (source (tackon source-dir to-copy))
  92.   (dest @default-dest)
  93.   (optional force)
  94.  )
  95. )
  96.  
  97. (procedure copy-files
  98.  (if (exists (tackon @default-dest "Miami"))
  99.   (delete (tackon @default-dest "Miami") force)
  100.  )
  101.  (if (exists (tackon @default-dest "Miami.info"))
  102.   (delete (tackon @default-dest "Miami.info") force)
  103.  )
  104.  (if is-in-place
  105.   (
  106.    (if cpu-choice
  107.     (
  108.      (delete (tackon @default-dest "Miami.000") force)
  109.      (delete (tackon @default-dest "Miami.000.info") force)
  110.      (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  111.      (rename (tackon @default-dest "Miami.020.info") (tackon @default-dest "Miami.info"))
  112.     )
  113.     (
  114.      (delete (tackon @default-dest "Miami.020") force)
  115.      (delete (tackon @default-dest "Miami.020.info") force)
  116.      (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  117.      (rename (tackon @default-dest "Miami.000.info") (tackon @default-dest "Miami.info"))
  118.     )
  119.    )
  120.    (complete 50)
  121.   ) (
  122.    (if cpu-choice
  123.     (set to-copy "Miami.020")
  124.     (set to-copy "Miami.000")
  125.    )
  126.    (copy-file)
  127.    (if cpu-choice
  128.     (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  129.     (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  130.    )
  131.    (set to-copy "Miami.guide") (copy-file)
  132.    (set to-copy "Miami.guide.info") (copy-file)
  133.    (set to-copy "MiamiFinger") (copy-file)
  134.    (set to-copy "MiamiIfConfig") (copy-file)
  135.    (set to-copy "MiamiInit") (copy-file)
  136.    (set to-copy "MiamiInit.info") (copy-file)
  137.    (set to-copy "MiamiInitSANA2") (copy-file)
  138.    (set to-copy "MiamiInitSANA2.info") (copy-file)
  139.    (set to-copy "MiamiNetStat") (copy-file)
  140.    (set to-copy "MiamiPing") (copy-file)
  141.    (set to-copy "MiamiRegister") (copy-file)
  142.    (set to-copy "MiamiRegister.info") (copy-file)
  143.    (set to-copy "MiamiResolve") (copy-file)
  144.    (set to-copy "MiamiRoute") (copy-file)
  145.    (set to-copy "MiamiSysCtl") (copy-file)
  146.    (set to-copy "MiamiTCPDump") (copy-file)
  147.    (set to-copy "MiamiTraceRoute") (copy-file)
  148.    (set to-copy "README_FIRST") (copy-file)
  149.    (set to-copy "README_FIRST.info") (copy-file)
  150.    (complete 25)
  151.    (if (not (exists (tackon @default-dest "libs")))
  152.     (makedir (tackon @default-dest "libs"))
  153.    )
  154.    (copyfiles
  155.     (source (tackon source-dir "libs"))
  156.     (dest (tackon @default-dest "libs"))
  157.     (all)
  158.    )
  159.   )
  160.  )
  161.  (set to-copy
  162.   (select icon-choice
  163.    "Icons/Standard/Miami.info"
  164.    "Icons/MagicWB/Miami.info"
  165.    "Icons/NewIcons/Miami.info"
  166.   )
  167.  )
  168.  (copyfiles
  169.   (source (tackon source-dir to-copy))
  170.   (dest @default-dest)
  171.  )
  172.  (copyfiles
  173.   (source (tackon source-dir to-copy))
  174.   (dest @default-dest)
  175.   (newname "MiamiInit.info")
  176.  )
  177.  (copyfiles
  178.   (source (tackon source-dir to-copy))
  179.   (dest @default-dest)
  180.   (newname "MiamiInitSANA2.info")
  181.  )
  182.  (copyfiles
  183.   (source (tackon source-dir to-copy))
  184.   (dest @default-dest)
  185.   (newname "MiamiRegister.info")
  186.  )
  187.  (complete 50)
  188. )
  189.  
  190. (procedure set-tooltypes
  191.  (tooltype
  192.   (dest (tackon @default-dest "Miami"))
  193.   (noposition)
  194.  )
  195.  (tooltype
  196.   (dest (tackon @default-dest "MiamiInit"))
  197.   (noposition)
  198.  )
  199.  (tooltype
  200.   (dest (tackon @default-dest "MiamiInitSANA2"))
  201.   (noposition)
  202.  )
  203.  (tooltype
  204.   (dest (tackon @default-dest "MiamiRegister"))
  205.   (noposition)
  206.  )
  207.  (tooltype
  208.   (dest (tackon @default-dest "Miami.guide"))
  209.   (noposition)
  210.   (setdefaulttool ag-browser)
  211.  )
  212. )
  213.  
  214. (procedure add-to-startup
  215.  (if old-miami-assign
  216.   (if (= (old-miami-assign-location (expandpath @default-dest)))
  217.    (set change-startup 0)
  218.    (set change-startup 1)
  219.   )
  220.   (set change-startup 1)
  221.  )
  222.  (if change-startup
  223.   (
  224.    (set startup-addition (cat
  225.     "assign Miami: \"" (expandpath @default-dest) "\"\n"
  226.     )
  227.    )
  228.    (if
  229.     (askbool
  230.      (prompt "It is strongly recommended that an assign "
  231.       "'Miami:' is created for the Miami installation "
  232.       "directory. Miami by itself will work fine without "
  233.       "this assign, but some utility programs like "
  234.       "MiamiTCPDump need it. Would you like Installer "
  235.       "to make the required change to your user-startup "
  236.       "file ?")
  237.      (help "It is strongly recommended that an assign "
  238.       "'Miami:' is created for the Miami installation "
  239.       "directory. Miami by itself will work fine without "
  240.       "this assign, but some utility programs like "
  241.       "MiamiTCPDump need it. Please indicate if you would like Installer "
  242.       "to make the required change to your user-startup "
  243.       "file.")
  244.      (choices "Yes" "No")
  245.     )
  246.     (startup "Miami"
  247.      (command startup-addition)
  248.      (prompt "Installer will modify your s:user-startup "
  249.       "script. The following lines will be added:\n\n"
  250.       startup-addition)
  251.      (help "Installer will modify your s:user-startup "
  252.       "script. The following lines will be added:\n\n"
  253.       startup-addition)
  254.     )
  255.     (textfile
  256.      (dest (tackon @default-dest "addition-to-user-startup"))
  257.      (append startup-addition)
  258.     )
  259.    )
  260.   )
  261.  )
  262. )
  263.      
  264.  
  265. ;;;; Start
  266.  
  267. (welcome "Welcome to the Miami 2.0 installation.\n")
  268.  
  269. (set app-name "Miami 2.0")
  270.  
  271. (check-system-version)
  272.  
  273. (complete 0)
  274.  
  275. (set source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  276.  (expandpath @icon))
  277. )
  278.  
  279. (select-destination-directory)
  280.  
  281. (check-registered)
  282.  
  283. (select-cpu)
  284.  
  285. (select-icon)
  286.  
  287. (check-in-place)
  288.  
  289. (copy-files)
  290.  
  291. (set-tooltypes)
  292.  
  293. (complete 75)
  294.  
  295. (add-to-startup)
  296.  
  297. (complete 100)
  298.